﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace MuXue.Zyiz.Template.OuterClient.MsgClient
{
    public class MsgApiResult<T>
    {
        /// <summary>
        /// 详见返回码列表
        /// </summary>
        public string Return_code { get; set; }
        /// <summary>
        /// 返回码不为“0000”，则返回具体描述
        /// </summary>
        public string Return_msg { get; set; }
        /// <summary>
        /// 返回内容，详见各接口定义
        /// </summary>
        public T Return_data { get; set; }
    }

    public class TokenResp
    {
        public string token { get; set; }
    }

    public class WeiXinWorkMessageResponse
    {
        /// <summary>
        /// 消息ID
        /// </summary>
        public string MessageId { get; set; }
    }



    /// <summary>
    /// 向企业微信推送消息
    /// </summary>
    public class WeiXinWorkMessageReq
    {
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="_touser"></param>
        /// <param name="msg"></param>
        public WeiXinWorkMessageReq(string _touser, string msg)
        {
            touser = _touser;
            text = new WeiXinWorkTextMessage();
            text.content = msg;
            agentid = 0;
            msgtype = "text";
        }
        /// <summary>
        /// 成员ID列表（消息接收者，多个接收者用‘|’分隔，最多支持1000个）。特殊情况：指定为@all，则向该企业应用的全部成员发送
        /// </summary>
        public string touser { get; set; }

        public string msgtype { get; set; } = "text";

        public int agentid { get; set; } = 0;

        public WeiXinWorkTextMessage text { get; set; } = new WeiXinWorkTextMessage();


    }

    public class WeiXinWorkTextMessage
    {
        public string content { get; set; }
    }

}
